//index.js
//获取应用实例
const {getCatHttp} = require("../../models/http")
Page({
  data:{
    playlists:[]
  },
  onLoad:async function(){
    var res = await getCatHttp()
    var playlists = res.data.playlists
    this.setData({
      playlists
    })
  },
  onDelete(event){
    var id = event.detail
    var playlists = this.data.playlists
    var res = playlists.filter(item=>item.id!=id)
    this.setData({
      playlists:res
    })
  }
})
